<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <appender name="consoleAppender" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <Pattern>.%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg %n
            </Pattern>
        </encoder>
        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
            <level>TRACE</level>
        </filter>

    </appender>

    <appender name="dailyRollingFileAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <File>c:/tmp/rest-demo.log</File>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <!-- daily rollover -->
            <FileNamePattern>rest-demo.%d{yyyy-MM-dd}.log</FileNamePattern>

            <!-- keep 30 days' worth of history -->
            <maxHistory>30</maxHistory>
        </rollingPolicy>

        <encoder>
            <Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{35} - %msg %n</Pattern>
        </encoder>
    </appender>
    <appender name="minuteRollingFileAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <!-- rollover every minute -->
            <FileNamePattern>c:/tmp/minutes/rest-demo-minute.%d{yyyy-MM-dd_HH-mm}.log</FileNamePattern>

            <!-- keep 30 minutes' worth of history -->
            <maxHistory>30</maxHistory>
        </rollingPolicy>

        <encoder>
            <Pattern>%-4relative [%thread] %-5level %logger{35} - %msg %n</Pattern>
        </encoder>
    </appender>

    <logger name="org.codingpedia" additivity="false">
        <level value="DEBUG" />
        <appender-ref ref="dailyRollingFileAppender"/>
        <appender-ref ref="minuteRollingFileAppender"/>
        <appender-ref ref="consoleAppender" />
    </logger>

    <logger name="org.springframework.beans.factory.support"
            level="debug" />
    <root>
        <level value="debug" />
        <appender-ref ref="consoleAppender" />
    </root>
</configuration>
